#include "controlwidget.h"
#include "openglwidget.h"
#include <QVBoxLayout>

ControlWidget::ControlWidget(OpenGLWidget *glWidget, QWidget *parent)
    : QWidget(parent), m_glWidget(glWidget)
{
    m_zoomFitButton = new QPushButton("Zoom Fit", this);

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->addWidget(m_zoomFitButton);
    setLayout(layout);

    connect(m_zoomFitButton, &QPushButton::clicked, this, &ControlWidget::onZoomFitClicked);
}

void ControlWidget::onZoomFitClicked()
{
    m_glWidget->zoomFit();
}
